<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>v-model 在单选框中的使用</title>
    <script src="/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <!-- 单选框只能选择一个值，所以使用一个变量保存 -->
      <input type="radio" name="gender" value="man" v-model="gender" />男
      <input type="radio" name="gender" value="woman" v-model="gender" />女
    </div>
    <script>
      Vue.config.productionTip = false;
      const vm = new Vue({
        el: "#app",
        data: {
          gender: "man",
        },
      });
    </script>
  </body>
</html>
